<script lang="ts" setup>
import { reactive } from 'vue'
import { useRouter } from 'vue-router'

const user = reactive({
  username: '',
  password: '',
})
const router = useRouter()
const submit = () => {
  console.log(user.value)
  router.push({
    name: 'HomePage'
  })
};
</script>

<template>
  <div class="login-page">
    <div class="login-page__context">
      <h1 class="login-page__context-title">账号密码登录</h1>
      <el-input
        class="login-page__context-username"
        v-model="user.username"
        placeholder="账号"
      />
      <el-input
        class="login-page__context-password"
        v-model="user.password"
        placeholder="密码"
      />
      <el-button
        class="login-page__context-submit"
        type="primary"
        @click="submit"
      >登录</el-button>
    </div>
  </div>
</template>

<style lang="scss" scoped>
.login-page {
  width: 100%;
  height: 100%;
  background-image: url("../assets/images/login-banner.png");
  background-size: 100% 100%;
  &__context {
    position:fixed;
    right: 5vw;
    top: 50%;
    margin-top: -14.5vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 26vw;
    height: 29.12vw;
    min-width: 250px;
    min-height: 340px;
    padding: 3vw 5vw;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0px 16px 40px rgba(0, 0, 0, 0.07);
    &-title {
      margin-bottom: 1vw;
    }
    &-username {
      margin-bottom: 1vw;
    }
    &-password {
      margin-bottom: 1vw
    }
    &-submit {
      width: 100%;
    }
  }
}
</style>
